var vue = new Vue({
	el: "body",
	data: {
		username: "",
		isloading: true,
		load: false,
		nickname: ""
	},
	created: function() {
		var token = sessionStorage.getItem("token");
		var appid = sessionStorage.getItem("appid");
		this.username = sessionStorage.getItem("username");
		if (this.username != null) {
			this.load = true;
			console.log(this.username);
			this.getNickname(appid, token);
		}

	},
	methods: {
		getNickname: function(appid, token) {
			$.ajax({
				type: 'get',
				url: "http://v2.mashupcloud.cn/SQL/select_userinfo/",
				async: true,
				data: {
					appid: appid,
					token: token,
					name: 'select_userinfo',
					_v1: this.username
				},
				success: function(json) {
					vue.nickname = JSON.parse(json)[2][0].nickname;
					console.log(vue.nickname)
				},
				error: function(json) {
					console.log("err:" + json);
				}
			});
		},
		setinfo: function() {
			location.href = "../redact/redact.html"
		}
	}
});